#include "main.h"
#include "stm32f1xx_it.h"
#include "Peripheral.h"


static volatile IP_IRQ_Call_Def SysTick_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};

static volatile IP_IRQ_Call_Def DMA1_Channel0_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA1_Channel1_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA1_Channel2_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA1_Channel3_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA1_Channel4_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA1_Channel5_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA1_Channel6_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA1_Channel7_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};

static volatile IP_IRQ_Call_Def DMA2_Channel0_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA2_Channel1_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA2_Channel2_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA2_Channel3_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA2_Channel4_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA2_Channel5_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA2_Channel6_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};
static volatile IP_IRQ_Call_Def DMA2_Channel7_IRQ_Call={.IP_IRQ_Callback=NULL,.v=NULL};




/**
 * @brief 设置SysTick中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void SysTick_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  SysTick_IRQ_Call.v=v;
  SysTick_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}



/**
 * @brief 设置DMA1数据流0中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel0_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel0_IRQ_Call.v=v;
  DMA1_Channel0_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA1数据流1中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel1_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel1_IRQ_Call.v=v;
  DMA1_Channel1_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA1数据流2中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel2_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel2_IRQ_Call.v=v;
  DMA1_Channel2_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA1数据流3中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel3_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel3_IRQ_Call.v=v;
  DMA1_Channel3_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA1数据流4中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel4_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel4_IRQ_Call.v=v;
  DMA1_Channel4_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA1数据流5中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel5_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel5_IRQ_Call.v=v;
  DMA1_Channel5_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA1数据流6中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel6_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel6_IRQ_Call.v=v;
  DMA1_Channel6_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA1数据流7中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA1_Channel7_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA1_Channel7_IRQ_Call.v=v;
  DMA1_Channel7_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}



/**
 * @brief 设置DMA2数据流0中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel0_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel0_IRQ_Call.v=v;
  DMA2_Channel0_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA2数据流1中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel1_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel1_IRQ_Call.v=v;
  DMA2_Channel1_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA2数据流2中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel2_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel2_IRQ_Call.v=v;
  DMA2_Channel2_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA2数据流3中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel3_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel3_IRQ_Call.v=v;
  DMA2_Channel3_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA2数据流4中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel4_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel4_IRQ_Call.v=v;
  DMA2_Channel4_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA2数据流5中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel5_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel5_IRQ_Call.v=v;
  DMA2_Channel5_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA2数据流6中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel6_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel6_IRQ_Call.v=v;
  DMA2_Channel6_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}

/**
 * @brief 设置DMA2数据流7中断调用函数
 * @param IP_IRQ_Callback 中断调用
 * @param v 中断调用传入的参数
 * @return 无
 */
void DMA2_Channel7_SetIrqCallback(void (*IP_IRQ_Callback)(void*),void* v){
  DMA2_Channel7_IRQ_Call.v=v;
  DMA2_Channel7_IRQ_Call.IP_IRQ_Callback=IP_IRQ_Callback;
}






















void DMA1_Channel0_IRQHandler(void){
  DMA1_Channel0_IRQ_Call.IP_IRQ_Callback(DMA1_Channel0_IRQ_Call.v);
}
void DMA1_Channel1_IRQHandler(void){
  DMA1_Channel1_IRQ_Call.IP_IRQ_Callback(DMA1_Channel1_IRQ_Call.v);
}
void DMA1_Channel2_IRQHandler(void){
  DMA1_Channel2_IRQ_Call.IP_IRQ_Callback(DMA1_Channel2_IRQ_Call.v);
}
void DMA1_Channel3_IRQHandler(void){
  DMA1_Channel3_IRQ_Call.IP_IRQ_Callback(DMA1_Channel3_IRQ_Call.v);
}
void DMA1_Channel4_IRQHandler(void){
  DMA1_Channel4_IRQ_Call.IP_IRQ_Callback(DMA1_Channel4_IRQ_Call.v);
}
void DMA1_Channel5_IRQHandler(void){
  DMA1_Channel5_IRQ_Call.IP_IRQ_Callback(DMA1_Channel5_IRQ_Call.v);
}
void DMA1_Channel6_IRQHandler(void){
  DMA1_Channel6_IRQ_Call.IP_IRQ_Callback(DMA1_Channel6_IRQ_Call.v);
}
void DMA1_Channel7_IRQHandler(void){
  DMA1_Channel7_IRQ_Call.IP_IRQ_Callback(DMA1_Channel7_IRQ_Call.v);
}


void DMA2_Channel0_IRQHandler(void){
  DMA2_Channel0_IRQ_Call.IP_IRQ_Callback(DMA2_Channel0_IRQ_Call.v);
}
void DMA2_Channel1_IRQHandler(void){
  DMA2_Channel1_IRQ_Call.IP_IRQ_Callback(DMA2_Channel1_IRQ_Call.v);
}
void DMA2_Channel2_IRQHandler(void){
  DMA2_Channel2_IRQ_Call.IP_IRQ_Callback(DMA2_Channel2_IRQ_Call.v);
}
void DMA2_Channel3_IRQHandler(void){
  DMA2_Channel3_IRQ_Call.IP_IRQ_Callback(DMA2_Channel3_IRQ_Call.v);
}
void DMA2_Channel4_IRQHandler(void){
  DMA2_Channel4_IRQ_Call.IP_IRQ_Callback(DMA2_Channel4_IRQ_Call.v);
}
void DMA2_Channel5_IRQHandler(void){
  DMA2_Channel5_IRQ_Call.IP_IRQ_Callback(DMA2_Channel5_IRQ_Call.v);
}
void DMA2_Channel6_IRQHandler(void){
  DMA2_Channel6_IRQ_Call.IP_IRQ_Callback(DMA2_Channel6_IRQ_Call.v);
}
void DMA2_Channel7_IRQHandler(void){
  DMA2_Channel7_IRQ_Call.IP_IRQ_Callback(DMA2_Channel7_IRQ_Call.v);
}












void NMI_Handler(void){
}

void HardFault_Handler(void){
  for(;;){
  }
}

void MemManage_Handler(void){
  for(;;){
  }
}

void BusFault_Handler(void){
  for(;;){
  }
}

void UsageFault_Handler(void){
  for(;;){
  }
}

void SVC_Handler(void){
}

void DebugMon_Handler(void){
}

// void PendSV_Handler(void){
// }

void SysTick_Handler(void){
  TimeTick++;
  SysTick_IRQ_Call.IP_IRQ_Callback(SysTick_IRQ_Call.v);
}



